# Maintainer: Patrick Gansterer <paroga@paroga.com>
pkgname=mdbook-mermaid
pkgver=0.13.0
pkgrel=0
pkgdesc="Preprocessor for mdbook to render mermaid diagrams"
url="https://github.com/badboy/mdbook-mermaid"
# loongarch64: blocked by libc crate
arch="all !loongarch64"
license="MPL-2.0"
depends="mdbook"
makedepends="cargo cargo-auditable"
source="https://github.com/badboy/mdbook-mermaid/archive/refs/tags/v$pkgver/mdbook-mermaid-$pkgver.tar.gz"

prepare() {
	default_prepare

	cargo fetch --target="$CTARGET" --locked
}

build() {
	cargo auditable build --frozen --release
}

check() {
	cargo test --frozen
}

package() {
	install -D -m755 target/release/$pkgname -t "$pkgdir"/usr/bin/
}

sha512sums="
e1521e1c457bb8c9761f8b30a6312cf04e5829eee3a56b8f80aba218764891f27d1f4d3df5504a79fe82d299ff7a2cbd46ee83a92df2ea9fdc79e6c185695ec5  mdbook-mermaid-0.13.0.tar.gz
"
